export default function(card = {
	printid: ""
}) {
	if (!card) {
		card = {
			printid: ""
		}
	}
	let types = [{
			label: '消费卡',
			value: '0',
			dw: '元',
			fl: '100',
			jelabel: "余额"
		},
		{
			label: '次数卡',
			value: '1',
			dw: '次',
			jelabel: "剩余次数"
		},
		{
			label: '站点消费卡',
			value: '2',
			dw: '元',
			fl: '100',
			jelabel: "余额"
		},
		{
			label: '月卡(整月)',
			value: '3',
			dw: '月',
			jelabel: "本月次数"

		},
		{
			label: '月卡',
			value: '4',
			dw: '月',
			jelabel: "本月次数"
		},
		{
			label: '时间月卡',
			value: '5',
			dw: '小时',
			fl: '60',
			jelabel: "本月时间"
		},
		{
			label: '到期卡',
			value: '6',
			dw: '次/日',
			jelabel: "今日剩余次数"

		}
	];

	console.log(card, "cardcardcard");
	let r = types.find(function(e) {
		return e.value == card.type
	})
	r = r ? r : types[0];
	let je = "";
	if (card.type == 1 || card.type == 4 || card.type == 3 || card.type == 6) {
		je = card.je + "次"
	} else if (card.type == 5) {
		je = (card.je / 60).toFixed(1) + "小时"
	} else if (card.type == 2 || card.type == 0) {
		je = card.je / 100 + "元"
	}
	r.je = je;
	if (card.type == 4 || card.type == 3) {
		r.jelabel2 = "剩余月份";
		r.je2 = card.yys + "月";
	}
	if (card.type == 5) {
		r.jelabel2 = "激活时间";
		r.je2 = card.sjs;
		r.jelabel3 = "剩余月份";
		r.je3 = card.yys + "月";
	}
	r.ctype = card.printid.indexOf("E") >= 0 ? 1 : 0;
	for (let key in r) {
		r[key] = uni.$z.$t(r[key])
	}
	return {
		...card,
		...r
	};
}